Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt

Use this file to discover all available pages before exploring further.

TuPerfil.net uses Supabase for the PostgreSQL database, authentication, and file storage. Follow these steps to create a new project and prepare it for the application.
1

Create a Supabase account

Go to supabase.com and sign up or log in. The free tier is sufficient for development and small production deployments.
2

Create a new project

From the Supabase dashboard, click New project and fill in:
  • Name — e.g. tuperfil-net
  • Database password — choose a strong password and save it somewhere safe; you will not need it day-to-day, but you may need it to connect via direct Postgres tooling
  • Region — choose the region closest to your users (e.g. South America for an Argentine audience)
Click Create new project and wait about one minute for provisioning to complete.
3

Run the initial schema migration

Open SQL Editor in the left sidebar, click New query, paste the full contents of supabase/migrations/001_initial_schema.sql, and click Run.This migration creates the core schema:
  • categories table with the six default news categories
  • articles table with RLS policies (public read for published articles, authenticated write)
  • contacts table (public insert, authenticated read)
  • article-images storage bucket with public read and authenticated write policies
  • update_updated_at() trigger function
After running migration 001, continue running migrations 002 through 019 in order. See the Migrations page for the full list and instructions.
4

Get your API keys

Go to SettingsAPI in the Supabase dashboard. You need three values:
KeyField in dashboardVariable name
Project URLProject URLNEXT_PUBLIC_SUPABASE_URL
Anon keyProject API keysanon publicNEXT_PUBLIC_SUPABASE_ANON_KEY
Service role keyProject API keysservice_role secretSUPABASE_SERVICE_ROLE_KEY
Copy these into your .env.local file. See Environment variables for details.
5

Create the first admin user

Go to AuthenticationUsersAdd userCreate new user. Enter an email address and a secure password.This is the account you will use to log in at /admin.
If you have already run migration 012_user_roles.sql, the first user created automatically receives the admin role. Subsequent users receive the editor role. You can change roles directly in the profiles table via the Table Editor.
6

(Optional) Run seed data

If you want sample articles to test the public site, open the SQL Editor, paste the contents of supabase/seed.sql, and run it.The seed script automatically uses the first user in auth.users as the author, so it works without any manual substitution. It creates one published article in each of the six categories:
CategoryArticle
Perfil PolíticoGovernment economic measures
Perfil JudicialHistoric corruption ruling
Perfil SaludRecord vaccination campaign
Perfil DeportivoLocal team reaches national final
Perfil RegionalNew water treatment plant
Perfil InternacionalClimate summit historic agreements
Seed data is useful for verifying that the homepage, category pages, and article pages all render correctly before publishing real content.

Row Level Security

RLS is enabled on every table in the schema. You do not need to configure it manually — the migrations set up the correct policies. The key rules are:
TableAnonymous (unauthenticated)Authenticated
articlesRead published, non-deleted articlesFull CRUD
categoriesRead allFull CRUD
contactsInsert onlyRead, update, delete
commentsInsert; read approved onlyFull CRUD
subscribersInsert (subscribe)Read, update, delete
adsRead active adsFull CRUD
breaking_newsRead allInsert, update
page_viewsInsertRead
ad_eventsInsertRead
Do not disable RLS on any table. The application relies on these policies to keep unpublished articles and contact messages private.

Allowed URL origins

After you deploy to Vercel (or any custom domain), add your production URL to AuthenticationURL ConfigurationSite URL and Redirect URLs. Without this, Supabase will reject authentication callbacks from your production domain.